home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / MPW Related / MPW Interfaces & Libraries / RIncludes / Cmdo.r < prev    next >
Encoding:
Text File  |  1992-06-17  |  13.4 KB  |  390 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Cmdo.r
  3.  
  4.     CMDO.R    - Resource description file for building Commando resources.
  5.  
  6.     Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8.     Change History (most recent first):
  9.  
  10.         <1+>     6/23/92    DCL        Changed #ifndef __CMDO.R__ to __CMDO_R__
  11.  
  12. */
  13.  
  14.  
  15. #ifndef __CMDO_R__
  16. #define __CMDO_R__
  17.  
  18. #define    FilesID                        0
  19. #define    MultiFilesID                1
  20. #define    CheckOptionID                2
  21. #define    RadioButtonsID                3
  22. #define    RegularEntryID                4
  23. #define    MultiRegularEntryID            5
  24. #define    BoxID                        6
  25. #define    TextBoxID                    7
  26. #define    PopUpID                        8
  27. #define    NestedDialogID                9
  28. #define    TextTitleID                    10
  29. #define    RedirectionID                11
  30. #define    EditPopUpID                    12
  31. #define    TriStateButtonsID            13
  32. #define    ListID                        14
  33. #define    PictOrIconID                15
  34. #define    DummyID                        16
  35. #define    DoItButtonID                17
  36. #define    VersionDialogID                18
  37.  
  38. #define    CMDOVersion                    8
  39.  
  40. /*        The following are used to set styles, simply add for desired style.
  41. */
  42. #define bold            1
  43. #define italic            2
  44. #define underline        4
  45. #define outline         8
  46. #define shadow            16
  47. #define condense        32
  48. #define extend            64
  49.  
  50. type 'cmdo' {
  51.   integer = CMDOVersion;                                    /* Version number */
  52.   integer = $$CountOf(dialogs);                                /* # of dialogs, at least 1 */
  53.   array dialogs {
  54.     integer;                                                /* height of the dialog */
  55.     cstring;                                                /* text displayed in help window */
  56.     align word;
  57.  
  58.     integer = $$CountOf(itemArray);                            /* # of items */
  59.     
  60.     /* The order in which Commando writes out the options is the same order in which the
  61.        items in this array are entered in your resource declaration.  This is important
  62.        for those commands which have position dependent parameters. */
  63.        
  64.     wide array itemArray {
  65.         switch {
  66.             case NotDependent:
  67.                 key int = 0;
  68.             
  69.             case Or:
  70.                 key byte = 1;
  71.                 byte = $$CountOf(OrArray);
  72.                 wide array OrArray {
  73.                     int;                                    /* item number dependent upon */
  74.                 };
  75.             
  76.             case And:
  77.                 key byte = 2;
  78.                 byte = $$CountOf(AndArray);
  79.                 wide array AndArray {
  80.                     int;                                    /* item number dependent upon */
  81.                 };
  82.         };
  83.         switch {
  84.             case Files:
  85.                 key byte = FilesID;
  86.                 byte    InputFile,                            /* These types require the  */
  87.                         InputFileOrDir,                        /* 'Additional' case below. */
  88.                         InputOrOutputFile,
  89.                         InputOrOutputOrDir,
  90.                         
  91.                         OutputFile,                            /* These types require the  */
  92.                         OutputFileOrDir,                    /* 'NoMore' case below.     */
  93.                         DirOnly;
  94.                 switch {
  95.                     case OptionalFile:
  96.                         /* Using this case makes a popup with two or three items.
  97.                            This first item is used to select a default file or to
  98.                            select no file.  The second (and third) item(s) are used
  99.                            to select input or output files. */
  100.                         key int = 0;
  101.                         rect;                                /* bounds of title */
  102.                         rect;                                /* bounds of display box */
  103.                         cstring;                            /* title */
  104.                         cstring;                            /* default file */
  105.                         cstring;                            /* option to return before file */
  106.                         cstring;                            /* If this item is dependent upon
  107.                                                                another Files item, an extension
  108.                                                                can be specified here to be added
  109.                                                                to the dependents file. */
  110.                         cstring;                            /* help text for popup */
  111.                         byte        dim, dontDim;            /* Normally, dependent items are
  112.                                                                dimmed if the parent is disabled,
  113.                                                                if this field is "dontDim", then
  114.                                                                this item won't be dimmed */
  115.                         /* These next three strings are the strings displayed in the popup.  Most
  116.                            of the file types have only two strings but InputOrOutputFile and 
  117.                            InputOrOutputOrDir require three strings.  If a string is set to "",
  118.                            Commando will use a built-in default. */
  119.                         cstring;                            /* popup item #1 */
  120.                         cstring;                            /* popup item #2 */
  121.                         cstring;                            /* popup item #3 */
  122.                 
  123.                     case RequiredFile:
  124.                         /* Using this case makes a button that goes directly to standard
  125.                            file.  Use this case when a file is required and the user doesn't
  126.                            have the choice of a default file or no file. */
  127.                         key int = 1;
  128.                         rect;                                /* bounds of button */
  129.                         cstring;                            /* title of button */
  130.                         cstring;                            /* option to return before file */
  131.                         cstring;                            /* help text for button */
  132.                 };
  133.                 
  134.                 /* Some file types take additional information.  See the comment next to the
  135.                    file types to find out which case to choose here. */
  136.                 switch {
  137.                     case Additional:
  138.                         key    byte = 0;
  139.                         cstring;                                    /* For InputOrOutputFile, an option
  140.                                                                        can be specified when a new
  141.                                                                        (or output) file is chosen. */
  142.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  143.                                                                        If null, no radio buttons will be
  144.                                                                        displayed.  If FilterTypes is used,
  145.                                                                        the radio buttons will toggle
  146.                                                                        between showing files only with
  147.                                                                        the types below and all files */
  148.                         cstring;                                    /* title of only files button */
  149.                         cstring;                                    /* title of all files button */
  150.                         byte = $$CountOf(TypesArray);                /* up to 4 types may be specified */
  151.                         align word;
  152.                         array TypesArray {
  153.                             literal longint        text = 'TEXT',        /* desired input file type, specify */
  154.                                                 obj  = 'OBJ ',        /* no type for all types */
  155.                                                 appl = 'APPL',
  156.                                                 da   = 'DFIL',
  157.                                                 tool = 'MPST';
  158.                         };
  159.  
  160.                     case NoMore:
  161.                         key    byte = 1;
  162.                 };
  163.  
  164.             case MultiFiles:
  165.                 key byte = MultiFilesID;
  166.                 cstring;                                    /* button title */
  167.                 cstring;                                    /* help text for button */
  168.                 align word;
  169.                 rect;                                        /* bounds of button */
  170.                 cstring;                                    /* message like " Source files to compile: " */
  171.                 cstring;                                    /* option returned before each 
  172.                                                                filename. Can be null */
  173.                 switch {
  174.                     case MultiInputFiles:
  175.                         key byte = 0;
  176.                         byte = $$CountOf(MultiTypesArray);            /* up to 4 types may be specified */
  177.                         align word;
  178.                         array MultiTypesArray {
  179.                             literal longint        text = 'TEXT',        /* desired input file type, specify no type */
  180.                                                 obj  = 'OBJ ',        /* for all types */
  181.                                                 appl = 'APPL',
  182.                                                 da   = 'DFIL',
  183.                                                 tool = 'MPST';
  184.                         };
  185.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  186.                                                                        If null, no radio buttons will be
  187.                                                                        displayed.  If FilterTypes is used,
  188.                                                                        the radio buttons will toggle
  189.                                                                        between showing files only with
  190.                                                                        the types below and all files */
  191.                         cstring;                                    /* title of only files button */
  192.                         cstring;                                    /* title of all files button */
  193.             
  194.                     case MultiDirs:
  195.                         key byte = 1;
  196.  
  197.                     case MultiInputFilesAndDirs:
  198.                         key byte = 2;
  199.  
  200.                     case MultiOutputFiles:
  201.                         key byte = 3;
  202.                 };
  203.  
  204.             case CheckOption:
  205.                 key byte = CheckOptionID;
  206.                 byte    NotSet, Set;                        /* whether button is set or not */
  207.                 rect;                                        /* bounds */
  208.                 cstring;                                    /* title */
  209.                 cstring;                                    /* option returned */
  210.                 cstring;                                    /* help text for button */
  211.             
  212.             case RadioButtons:
  213.                 key byte = RadioButtonsID;
  214.                 byte = $$CountOf(radioArray);                /* # of buttons */
  215.                 wide array radioArray {
  216.                     rect;                                    /* bounds */
  217.                     cstring;                                /* title */
  218.                     cstring;                                /* option returned */
  219.                     byte    NotSet, Set;                    /* whether button is set or not */
  220.                     cstring;                                /* help text for button */
  221.                     align word;
  222.                 };
  223.             
  224.             case RegularEntry:
  225.                 key byte = RegularEntryID;
  226.                 cstring;                                    /* title */
  227.                 align word;
  228.                 rect;                                        /* bounds of title */
  229.                 rect;                                        /* bounds of input box */
  230.                 cstring;                                    /* default value */
  231.                 byte        ignoreCase, keepCase;            /* the default value is never displayed
  232.                                                                in the commando window.  If what the
  233.                                                                user types in the textedit window
  234.                                                                matches the default value, then that
  235.                                                                value isn't displayed.  This flag
  236.                                                                tells Commando whether to ignore case
  237.                                                                when comparing the contents of the textedit
  238.                                                                window with the default value. */
  239.                 cstring;                                    /* option returned */
  240.                 cstring;                                    /* help text for entry */
  241.  
  242.             case MultiRegularEntry:    /* For scrollable, lists of an option */
  243.                 key byte = MultiRegularEntryID;
  244.                 cstring;                                    /* title */
  245.                 align word;
  246.                 rect;                                        /* bounds of title */
  247.                 rect;                                        /* bounds of input list */
  248.                 byte = $$CountOf(DefEntryList);
  249.                 array DefEntryList {
  250.                     cstring;                                /* default values */
  251.                 };
  252.                 cstring;                                    /* option returned. Each value
  253.                                                                will be preceded with this
  254.                                                                option */
  255.                 cstring;                                    /* help text for entry */
  256.  
  257.             case Box:        /* Can be used to draw lines too */
  258.                 key byte = BoxID;
  259.                 byte            black, gray;                /* color of object */
  260.                 rect;                                        /* bounds of box or line */
  261.                 
  262.             case TextBox:    /* Draws a box with title in upper-left */
  263.                 key byte = TextBoxID;
  264.                 byte            black, gray;                /* color of object */
  265.                 rect;                                        /* bounds of box or line */
  266.                 cstring;                                    /* title */
  267.                 
  268.             case TextTitle:
  269.                 key byte = TextTitleID;
  270.                 byte        plain;                            /* style of text */            
  271.                 rect;                                        /* bounds of title */
  272.                 int            systemFont;                        /* font number to use */
  273.                 int            systemSize;                        /* font size to use */
  274.                 cstring;                                    /* the text to display */
  275.             
  276.             case PopUp:
  277.                 key byte = PopUpID;
  278.                 byte        Window, Alias, Font, Set;        /* popup type */
  279.                 rect;                                        /* bounds of title */
  280.                 rect;                                        /* bounds of popup line */
  281.                 cstring;                                    /* title */
  282.                 cstring;                                    /* option returned */
  283.                 cstring;                                    /* help text for popup */
  284.                 byte        noDefault, hasDefault;            /* hasDefault if first item is "Default Value" */
  285.  
  286.             case EditPopUp:
  287.                 key byte = EditPopUpID;
  288.                 /* For MenuItem, this EditPopUp must be dependent upon another EditPopUp
  289.                    of the MenuTitle type so that the control knows whose menu items to
  290.                    display.
  291.                    
  292.                    For FontSize, this EditPopUp must be dependent upon a PopUp of the
  293.                    Font type so that the control knows what sizes of the font exist. */
  294.                    
  295.                 byte     MenuTitle, MenuItem,                /* Type of editable pop-up */
  296.                         FontSize, Alias, Set;
  297.                 rect;                                        /* bounds of title */
  298.                 rect;                                        /* bounds of text edit area */
  299.                 cstring;                                    /* title */
  300.                 cstring;                                    /* option to return */
  301.                 cstring;                                    /* help text for textedit part */
  302.                 cstring;                                    /* help text for popup part */
  303.                 
  304.             case NestedDialog:
  305.                 key    byte = NestedDialogID;
  306.                 byte;                                        /* the number of the dialog
  307.                                                                to call.  It must be greater
  308.                                                                than the current dialog */
  309.                 rect;                                        /* bounds of button */
  310.                 cstring;                                    /* button's title */
  311.                 cstring;                                    /* help text for button */
  312.             
  313.             case Redirection:
  314.                 key byte = RedirectionID;
  315.                 byte    StandardOutput, DiagnosticOutput,    /* the type of redirection */
  316.                         StandardInput;
  317.                 point;                                        /* upper-left point of the whole contraption */
  318.  
  319.             case TriStateButtons:
  320.                 key byte = TriStateButtonsID;
  321.                 byte = $$CountOf(threeStateArray);            /* # of buttons */
  322.                 cstring;                                    /* option returned */
  323.                 wide array threeStateArray {
  324.                     align word;
  325.                     rect;                                    /* bounds */
  326.                     cstring;                                /* title */
  327.                     cstring;                                /* string for Clear state */
  328.                     cstring;                                /* string for DontTouch state */
  329.                     cstring;                                /* string for Set state */
  330.                     cstring;                                /* help text for button */
  331.                 };
  332.  
  333.             case List:        /* Puts up a list of "things" and allows multiple selections */
  334.                 key byte = ListID;
  335.                 byte        Volumes, ShellVars,
  336.                             Windows, Aliases;                /* what to display in the list */
  337.                 cstring;                                    /* option to return before each "thing" */
  338.                 cstring;                                    /* title */
  339.                 align word;
  340.                 rect;                                        /* bounds of title */
  341.                 rect;                                        /* bounds of list selection box */
  342.                 cstring;                                    /* help text for selection box */
  343.  
  344.             case PictOrIcon:
  345.                 key byte = PictOrIconID;
  346.                 byte    Icon, Picture;                        /* display a picture or icon */
  347.                 int;                                        /* resource id of icon/picture */
  348.                 rect;                                        /* display bounds */
  349.  
  350.             case Dummy:
  351.                 key byte = DummyID;
  352.  
  353.             case DoItButton:                                /* Allows the 'do it' button to be dependent */
  354.                 key byte = DoItButtonID;
  355.  
  356.             case VersionDialog:                                /* Display a dialog when the version # is clicked */
  357.                 key byte = VersionDialogID;
  358.                 switch {
  359.                     case VersionString:                        /* Version string embedded right here */
  360.                         key byte = 0;
  361.                         cstring;                            /* Version string of tool (e.g. V2.0) */
  362.                     
  363.                     case VersionResource:                    /* Versions string comes from another resource */
  364.                         key byte = 1;
  365.                         literal longint;                    /* resource type of pascal string containing version string */
  366.                         integer;                            /* resource id of version string */
  367.                 };
  368.                 cstring;                                    /* Version text for help window */
  369.                 align word;
  370.                 integer        noDialog;                        /* Rsrc id of 'DLOG' */
  371.                     /* NOTE •1: if there is no modal dialog to display when the version
  372.                        string is clicked, set the rsrc id to zero (noDialog).
  373.  
  374.                        NOTE •2: if the version string comes from another resource (VersionResource),
  375.                        the string must be the first thing in the resource and the string must be 
  376.                        a pascal-style string.  A 'STR ' resource is an example of a resource that
  377.                        fits the bill.
  378.                        
  379.                        NOTE •3: if the modal dialog is to have a filter proc, the proc
  380.                        must be linked as a 'fltr' resource with the same resource id
  381.                        as the dialog. */
  382.         };
  383.         align word;
  384.     };
  385.     align word;
  386.   };
  387. };
  388.  
  389. #endif __CMDO_R__
  390.